aux_source_directory (. SRC_LIST)

add_executable (sgw ${SRC_LIST})
add_compile_options(-g -Wall -Wextra -Wno-unused-function -Wno-unused-parameter -fPIC)
target_link_libraries(sgw pthread crypto ssl)
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

option(MD5 "enable check md5" OFF)
if(MD5)
    message("-- MD5: ON")
else()
    message("-- MD5: OFF")
endif()
option(TLS "enable use tls" OFF)
if(TLS)
    message("-- TLS: ON")
else()
    message("-- TLS: OFF")
endif()
configure_file(${PROJECT_SOURCE_DIR}/src/config.h.in ${PROJECT_SOURCE_DIR}/src/config.h @ONLY)

option(VER "enable name version" "1.0.0")
if(VER)
    message("-- version:   ${VER}")
    set(VERSION ${VER})
endif()
string(TIMESTAMP build_time "%Y-%m-%d %H:%M:%S")
set(BUILD_TIME ${build_time})
configure_file(${PROJECT_SOURCE_DIR}/src/version.h.in ${PROJECT_SOURCE_DIR}/src/version.h @ONLY)
